package com.example.shop.adapter

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.base.entity.GoodsEntity
import com.example.shop.R
import com.example.shop.utils.GlideUtils


class GoodsAdapter(list: MutableList<GoodsEntity>) :BaseQuickAdapter<GoodsEntity,BaseViewHolder>(R.layout.item_goods,list){
    override fun convert(holder: BaseViewHolder, item: GoodsEntity) {
        holder.setText(R.id.goods_desc,item.goods_desc)
        holder.setText(R.id.goods_price,"￥${item.goods_default_price}")
        //Glide.with(context).load(item.goods_default_icon).into(holder.getView(R.id.goods_iv))
        GlideUtils.loadCornersImage(context,item.goods_default_icon,holder.getView(R.id.goods_iv),20)
    }
}